<%@ page import="cn.dai.util.JdbcUtils" %>
<%@ page import="java.sql.Connection" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/6/3
  Time: 11:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>删除学员</title>
</head>
<body>

<%
    String id = request.getParameter("id");

    Connection connection = JdbcUtils.getConnection();

    String sql = "DELETE FROM java30 WHERE j30_id = ?";

    int update = JdbcUtils.update(connection, sql, new Object[]{id});

    System.out.println("影响的记录数：" + update);

    if (update > 0){
        response.sendRedirect(request.getContextPath()+"/backstage/panel.jsp");
        return;
    }

    // 如果修改失败该怎么办，这里我不知道如何处理？
%>

</body>
</html>
